package com.cip.client;

import com.google.gwt.user.client.Timer;
import com.smartgwt.client.types.AnimationEffect;
import com.smartgwt.client.types.DragAppearance;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;

public final class MensajePopUp {
	private static final Label cInstance = new Label();
	static {
		cInstance.setOverflow(Overflow.HIDDEN);
		cInstance.setBorder("1px solid black");
		cInstance.setBackgroundColor("#A0FFA0");
		cInstance.setOverflow(Overflow.HIDDEN);
		cInstance.setBorder("1px solid black");
		
		cInstance.setBackgroundColor("lightyellow");  
		cInstance.setCanDragReposition(true);
		cInstance.setCanDragResize(true);
		cInstance.setDragAppearance(DragAppearance.TARGET);
		// cInstance.setSmoothFade(true);
		//cInstance.setContents("1<br>2<br>3<br><b>Animated Object</b> (drag to move or resize)<br>3<br>2<br>1");
		cInstance.setLeft(100);
		cInstance.setRight(10);
		cInstance.setHeight(20);
		cInstance.setWidth100();
		
		cInstance.setOpacity(90);
	/*	cInstance.setTop(0);
		cInstance.setWidth(100);
		cInstance.setHeight(100);*/
		/*cInstance.setEdgeImage("corners/glow_35.png");
		cInstance.setEdgeSize(35);
		cInstance.setEdgeOffset(25);
		cInstance.setShowEdges(true);*/
		//cInstance.setEdgeShowCenter(true);
		//cInstance.setKeepInParentRect(true);
	}

	public static void show(String texto, String color) {
		cInstance.setContents(texto);
		cInstance.setBackgroundColor(color);  
		
		cInstance.animateShow(AnimationEffect.FADE, null, (int) 4000);

		Timer refreshTimer = new Timer() {
			@Override
			public void run() {
				cInstance.animateHide(AnimationEffect.FADE, null, (int) 4000);

			}
		};
		refreshTimer.scheduleRepeating(2000);

	}

}